package it.free.i.virtual.machine.hal.devicealias.echo;

import it.free.i.virtual.swarm.ComposableInformationUnit;
import it.free.i.virtual.swarm.ComposableInformationUnit.CIUGeneratorAllowedOperations;

/**  
 * Ping echo response DTO
 * @author stefano
 */
public class PingEchoImpl extends EchoImpl implements PingEcho {
	
	private int echoValue = 0;

	public PingEchoImpl(){
		super();
	}
	
	/**
	 * @return the echoValue
	 */
	public int getEchoValue() {
		return echoValue;
	}

	/**
	 * @param echoValue the echoValue to set
	 */
	public void setEchoValue(int echoValue) {
		this.echoValue = echoValue;
	}

	public ComposableInformationUnit getRenderedObjectImage() {
		
		ComposableInformationUnit composableInformationUnit = ComposableInformationUnit.Factory.createObject();
		
		composableInformationUnit.setAttribute("echoValue", this.echoValue);
		composableInformationUnit.setAllowedOperations(CIUGeneratorAllowedOperations.READ);
		
		composableInformationUnit.setCiuType(this.getClass().getName());
		
		return composableInformationUnit;
	}

}
